package com.zuikaku.nettychat.service.impl;

import com.zuikaku.nettychat.dao.UserMapper;
import com.zuikaku.nettychat.pojo.User;
import com.zuikaku.nettychat.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public User getUserByPhone(String phone) {
        return userMapper.getUserByPhone(phone);
    }

    @Override
    public int addUserByUser(User newUser) {
        return userMapper.insertSelective(newUser);
    }

    @Override
    public User getUserByPhoneAndPassword(String phone, String password) {
        return userMapper.getUserByPhoneAndPassword(phone,password);
    }

    @Override
    public List<User> queryUserByNick(String nick) {
        return userMapper.queryUserByNick(nick);
    }


}
